
function exit(){
	$("#maTypeName").val("");
	$("#operUser").val("");
	$("#typeId").val("");
	load();
	//关闭所有页面层
	layer.closeAll('page');
}
layui.use(['form', 'layedit', 'laydate','table'], function(){
	var table = layui.table
	,laydate = layui.laydate
	,form = layui.form
	,layer = layui.layer
	,layedit = layui.layedit;

	//日期
	laydate.render({
		elem: '#date'
	});

	laydate.render({
		elem: '#time'
	});
	//监听工具条
	table.on('tool(demo)', function(obj){
		var da = obj.data;

		if(obj.event === 'edit'){
			layer.open({
				type: 1	 //此处以iframe举例
				,title: '查看详情'
				,area: ['1000px', '490px']
				,offset: 'auto'
				,content:$('#detail')
				,success: function(layero){
					//执行重载
					table.reload('detail', {
						page: {
							curr: 1 //重新从第 1 页开始
						}
						,where: {
							finId:da.finId,
						}
					});
				
				},end : function() {
					//弹框关闭的回调函数
					$("#detail").hide();
				}
			});

		}

	});
	var $ = layui.$, active = {
			reload: function(){
				var date = $('#date');
				var time = $('#time');
				var typeName = $('#typeName');
				//执行重载
				table.reload('idTest', {
					page: {
						curr: 1 //重新从第 1 页开始
					}
				,where: {
					date: date.val(),
					time: time.val(),
					braName: typeName.val(),
				}
				});
			}
	};

	$('.demoTable .layui-btn').on('click', function(){
		var type = $(this).data('type');
		active[type] ? active[type].call(this) : '';
	});





});


function load() {
	var form = layui.form
	form.render();
}